Skip to content

feat: add project aware observability support for harness - #2275

Open
nborges-aws wants to merge 2 commits into
project-tracesfrom
harness-project-observability
Open

feat: add project aware observability support for harness#2275
nborges-aws wants to merge 2 commits into
project-tracesfrom
harness-project-observability

Conversation

@nborges-aws

@nborges-aws nborges-aws commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Description

Adds project-aware logs and traces for Harness resources

agentcore project log harness
agentcore project log harness --name FooHarness --target production
agentcore project traces harness list --name FooHarness --since 30m
agentcore project traces harness get <traceId> --name FooHarness --output trace.json

These commands resolve the project Harness through the selected target, then resolve its managed runtime before querying cloudwatch for requested records. They reuse the existing shared observability handlers and preserve the imperative harness commands.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

How have you tested the change?

Manual testing, plus added tests covering project harness -> runtime resolution for logs, named target and qualifier selection for trace list, and trace downloads through the project route.

  • bun run test (3177 pass, 0 fail)
  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.


Stack created with GitHub Stacks CLIGive Feedback 💬

@nborges-aws
nborges-aws added this pull request to stack #2274 September 10, 2026 19:23
@github-actions github-actions Bot added the size/m PR size: M label Sep 10, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the agentcore-harness-reviewing AgentCore Harness review in progress label Sep 10, 2026

@agentcore-devx-automation agentcore-devx-automation Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AgentCore Harness Review

Verdict: Looks good

The change cleanly mirrors the existing project log runtime / project traces runtime handlers for Harness, with the added step of resolving the managed Runtime via core.harness.resolveRuntime before hitting CloudWatch. Wiring, flags, log‑group construction (runtimeLogGroup(runtime.runtimeId, qualifier ?? DEFAULT)), region propagation from the resolved target, and README updates all look correct. Tests use temp dirs rather than fs mocks and only stub the true I/O boundaries (TestCoreClient), which matches the pattern used elsewhere.

One optional follow-up — not blocking:

  • src/handlers/project/log/harness.test.tsx and src/handlers/project/traces/harness.test.tsx don't cover the "multiple Harnesses without --name" or "Harness not deployed to target" error paths that the runtime peers (runtime.test.tsx) do. The shared code (selectProjectResource, resolveDeployedResource) is exercised by the runtime tests, but adding the parallel harness cases would guard against future divergence and confirm the Harness label appears correctly in the error messages.

No serious issues; nothing else to change before merge.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Sep 10, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Sep 10, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.27273% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.93%. Comparing base (fb04f87) to head (186b208).

Files with missing lines Patch % Lines
src/handlers/project/log/harness.tsx 93.61% 3 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           project-traces    #2275    +/-   ##
================================================
  Coverage           96.93%   96.93%            
================================================
  Files                 569      571     +2     
  Lines               39287    39395   +108     
================================================
+ Hits                38083    38188   +105     
- Misses               1204     1207     +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants